<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var request = new XMLHttpRequest();
    request.onreadystatechange = function () {
        var DONE = this.DONE || 4;
        if (this.readyState === DONE){
            console.log(request.response)
        }
    };
    request.upload.onprogress = function(e) {
        console.log(e)
    }
    request.onprogress = function(e) {
        console.log(e)
    }
    request.open('GET', 'http://ym.lwt.com/test.php', true);
    request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
    request.send(null);
</script>
</body>
</html>